use axum::response::{IntoResponse, Response};
use rbatis::{Uuid, crud_table};
use cores::db::DAOBase;
use cores::responses::CusResponse;


#[curd_entry]
#[crud_table(table_name: sys_user)]
#[derive(Debug, Clone)]
pub struct User {
    pub id: Option<Uuid>,
    pub username: Option<String>,
    pub password: Option<String>,
    pub mobile_phone: Option<String>,
    pub email: Option<String>,
    pub is_active: bool,
    pub delete_flag: bool,
}


#[curd_entry]
#[crud_table(table_name: sys_auth_client)]
#[derive(Clone, Debug)]
pub struct AuthClient {
    pub id: Option<Uuid>,
    pub client_name: Option<String>,
    pub client_icon: Option<String>,
    pub secret_key: Option<String>,
    pub redirect_url: Option<String>,
    pub is_active: bool,
    pub delete_flag: bool,
    pub apply_user_id: Uuid,
}


#[curd_entry]
#[crud_table(table_name: sys_oauth_user_authorize)]
#[derive(Clone, Debug)]
pub struct AuthUserClient {
    pub id: Option<Uuid>,
    pub client_id: Option<Uuid>,
    pub user_id: Option<Uuid>,
    pub oauth_user_name: Option<String>,
    pub delete_flag: bool,
}
